import Vue from 'vue'
import Router from 'vue-router'

import Index from '../pages/Index.vue'
import Position from '../pages/Position.vue'
import Search from '../pages/Search.vue'
import Mine from '../pages/Mine.vue'
import Detail from '../pages/Detail.vue'
import Page404 from '../pages/404.vue'
import City from '../pages/City.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: Index,
      redirect: '/position',
      children: [
        {
          path: '/position',
          component: Position
        },
        {
          path: '/search',
          component: Search,
          name: 'search'
        },
        {
          path: '/mine',
          component: Mine
        },
        {
          path: '/city',
          component: City
        }
      ]
    },
    {
      path: '/detail/:id',
      component: Detail,
      name: 'detail'
    },
    {
      path: '*',
      component: Page404
    }
  ]
})
